package com.msb.apipassenger.controller;

import com.msb.apipassenger.service.TokenService;
import com.msb.internalcommon.dto.ResponseResult;
import com.msb.internalcommon.response.TokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: WuWen
 * @Date: 2023/8/17 - 08 - 17 - 14:26
 * @Description: com.msb.apipassenger.controller
 * @version: 1.0
 */@RestController
public class TokenController {

     @Autowired
     private TokenService tokenService;

     @PostMapping("/token-refresh")
    public ResponseResult refreshToken(@RequestBody TokenResponse tokenResponse){

         String refreshToken = tokenResponse.getRefreshToken();
         System.out.println("原来的refreshToken："+refreshToken);

         return tokenService.refreshToken(refreshToken);
     }
}
